<template>
	<div id="tmpl">
	<div class="title">
    <h4 v-text="list.title" class="tit"></h4>
	<p>{{list.add_time | datefmt('YYYY-MM-DD')}}  {{list.click}}</p>
</div>
<div id="content" v-html="list.content">	
	</div>

	<comment :id='id'></comment>	
	</div>
</template>

<script>
	import commen from "../../kits/commen.js";
	import comment from "../suboom/comment.vue";
	export default{
		data(){
			return{
				id:-1,
				list:{}
			}
		},
		components:{
			comment
		},
		created(){
			this.id=this.$route.params.id
			this.getlist();
		},
		methods:{
			getlist(){
				var url=commen.apidomain+"/api/getnew/"+this.id;
			this.$http.get(url).then(function(res){
				var data=res.body;
				if(data.status!=0){
					return;
				}
				this.list=data.message[0];
			})
			}
			
		}
	}
</script>

<style scoped>
.tit{
	color:blue;
}
.title p{
	color: rgba(0,0,0,0.5);
}
.title,#content{
	padding: 10px;
}
</style>